<?php
// +----------------------------------------------------------------------
// | author: admin
// +----------------------------------------------------------------------

namespace app\adminapi\validate\user;


use app\common\validate\BaseValidate;


/**
 * DriverCredential验证器
 * Class DriverCredentialValidate
 * @package app\adminapi\validate\user
 */
class DriverCredentialValidate extends BaseValidate
{

    /**
     * 设置校验规则
     * @var string[]
     */
    protected $rule = [
        'id' => 'require',
        'user_id' => 'require',
        'id_card' => 'require',
        'driver_license_pic' => 'require',
        'driver_license_valid_date' => 'require',
        'vehicle_license_pic' => 'require',
        'vehicle_license_valid_date' => 'require',
        'network_license_pic' => 'require',
        'network_licensee_pic' => 'require',
        'car_pic' => 'require',
        'car_type_id' => 'require',
        'car_num' => 'require',
    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'user_id' => '用户ID',
        'id_card' => '身份证号码',
        'driver_license_pic' => '驾驶证照片',
        'driver_license_valid_date' => '驾驶证有效期',
        'vehicle_license_pic' => '行驶证照片',
        'vehicle_license_valid_date' => '行驶证有效期',
        'network_license_pic' => '网约驾驶证',
        'network_licensee_pic' => '网约车行驶证',
        'car_pic' => '车辆照片',
        'car_type_id' => '车辆类型',
        'car_num' => '车牌号',

    ];


    /**
     * @notes 添加场景
     * @return DriverCredentialValidate
     * @author admin
     * @date 2025/04/25 16:46
     */
    public function sceneAdd()
    {
        return $this->only(['user_id','id_card','driver_license_pic','driver_license_valid_date','vehicle_license_pic','vehicle_license_valid_date','car_num','network_license_pic','network_licensee_pic','car_pic','car_type_id']);
    }


    /**
     * @notes 编辑场景
     * @return DriverCredentialValidate
     * @author admin
     * @date 2025/04/25 16:46
     */
    public function sceneEdit()
    {
        return $this->only(['id','user_id','id_card','driver_license_pic','driver_license_valid_date','vehicle_license_pic','vehicle_license_valid_date','car_num','network_license_pic','network_licensee_pic','car_pic','car_type_id']);
    }


    /**
     * @notes 删除场景
     * @return DriverCredentialValidate
     * @author admin
     * @date 2025/04/25 16:46
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 详情场景
     * @return DriverCredentialValidate
     * @author admin
     * @date 2025/04/25 16:46
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }

}